<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Ping 一个服务器连接，如果没有连接则重新连接</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.mysql-ping" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">mysql_ping</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">mysql_ping</span> &mdash; <span class="dc-title">Ping 一个服务器连接，如果没有连接则重新连接</span></p>

   </div>
   <div class="refsect1 unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-seealtc" id="refsect1-function.mysql-ping-unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-unknown-seealtc">
    <h3 class="title">说明</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>mysql_ping</strong></span>
       ([ <span class="methodparam"><span class="type">resource</span> <code class="parameter">$
       link_identifier
       </code></span>
     ] ) : <span class="type">bool</span></div>

    <p class="para rdfs-comment">
     <span class="function"><strong>mysql_ping()</strong></span>
     检查到服务器的连接是否正常。如果断开，则自动尝试连接。本函数可用于空闲很久的脚本来检查服务器是否关闭了连接，如果有必要则重新连接上。如果到服务器的连接可用则
     <span class="function"><strong>mysql_ping()</strong></span> 返回 <strong><code>TRUE</code></strong>，否则返回 <strong><code>FALSE</code></strong>。
    </p>
    <p class="para">
     参见
     <span class="function"><a href="mysql_thread_id.html" class="function">mysql_thread_id()</a></span> 和
     <span class="function"><a href="mysql_list_processes.html" class="function">mysql_list_processes()</a></span>。
    </p>
   </div>

  </div></div></div></body></html>